package com.hyfrogx.modules.zoom.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hyfrogx.common.exception.MyException;
import com.hyfrogx.common.utils.QueryExt;
import com.hyfrogx.modules.operation.entity.HyAppPushEntity;
import com.hyfrogx.modules.zoom.entity.HyZoomMeeting;

/**
 * @author ：Li9527
 * @date ：Created in 2019-03-27 10:30
 * @description：会议室业务Service
 * @modified By：
 * @version: 1.0
 */
public interface HyZoomMeetingService extends IService<HyZoomMeeting> {

    /**
     * 分页查询会议室
     * @param query
     */
    Page selectPageByConditions(QueryExt query);

    /**
     * 举办会议接口/需要重新创建一个会议室,把之前的会议室删掉,并且将一些基本的写入的参数传过来
     * 也可直接将它视为刷新会议室并返回 token放入备用字段
     * @param hyZoomMeeting
     * @return HyZoomMeeting
     * @throws Exception
     */
    HyZoomMeeting openMeetZoom(HyZoomMeeting hyZoomMeeting);

    /**
     * 关闭会议室,正常流程下的结束会议接口
     * @param hyZoomMeeting
     * @return Integer
     */
    Integer closeMeetZoom(HyZoomMeeting hyZoomMeeting);

    /**
     * 删除会议室
     * @return int
     * @throws Exception
     */
    int deleteMeetZoom(HyZoomMeeting hyZoomMeeting);

    /**
     * 创建普通会议室
     * @param hyZoomMeeting
     * @return int
     * @throws Exception
     */
    int createMeetZoom(HyZoomMeeting hyZoomMeeting) throws Exception;

    /**
     * 重建会议室
     * @param hyZoomMeeting
     * @return
     * @throws Exception
     */
    HyZoomMeeting reBuildMeetZoom(HyZoomMeeting hyZoomMeeting) throws Exception;

    /**
     * 定时任务,每天23.59分检查是否有到达过期时间的会议室
     * @throws MyException
     */
    void checkHaveNeedCloseZoom() throws MyException;

    /**
     * 获取zoom那边的该场会议实时状态
     *
     * @throws Exception
     */
    Integer getTrueStatusFromZoom(HyZoomMeeting zoomMeeting);

    /**
     * 借用会议模块service调用发送推送
     * @return boolean
     */
    public boolean doPush(HyAppPushEntity appPush) throws Exception;

    /**
     * 查询所有用户的会议室，包括用户附属别人的会议室
     * @param query
     * @return
     */
    Page selectZoomMeeting(QueryExt query);

    /**
     * 定时任务,每天12.00检查是否7天/3天/1天后到期
     * @throws MyException
     */
    void willExpire() throws Exception;

    /**
     * 方数+时长获取开会系统收费
     * @throws MyException
     * @return ZoomPirce
     */
    public Integer getNeedpay(HyZoomMeeting metting) throws MyException;

    /**
     * 方数+时长获取参会系统收费
     * @throws MyException
     * @return ZoomPirce
     */
    public Integer getJoinBasicMeetNeedpay(HyZoomMeeting metting) throws MyException;

}
